package com.dangdang.reflect;

import com.dangdang.threadexam.ThreadA;

public class reflectTest1 {

    public static void main(String[] args) {
        //第一种方式获取class对象
        //com.dangdang.threadexam
        ThreadA threadA1 = new ThreadA();
        Class thrClass1 = threadA1.getClass();
        System.out.println(thrClass1.getClasses());

        //第二种方式获取class对象
        Class thrClass2 = ThreadA.class;
        System.out.println(thrClass1 == thrClass2);

        //第三种方式获取class对象
        try {
            Class threadClass3 = Class.forName("com.dangdang.threadexam.ThreadA");
            System.out.println(threadClass3 == thrClass2);

        }catch (ClassNotFoundException e) {
            e.getStackTrace();
        }

    }
}
